﻿using System.Security.Principal;

namespace SetPath
{
    public class Is
    {
        public static bool RunningAsAdministrator
        {
            get
            {
                using (WindowsIdentity identity = WindowsIdentity.GetCurrent())
                {
                    var principal = new WindowsPrincipal(identity);
                    return principal.IsInRole(WindowsBuiltInRole.Administrator);
                }
            }
        }
    }
}
